package demo;

public class Test {
    public static void main(String[] args) {
        MyArrayList myArrayList = new MyArrayList();
        myArrayList.add(1);
        myArrayList.add(2);
        myArrayList.add(3);
        myArrayList.add(4);
        myArrayList.add(5);
        myArrayList.display();

        try {
            myArrayList.add(1,99);
        }catch (AddIndexOutOfException e){
            e.printStackTrace();
        }

        myArrayList.display();

        try {
            System.out.println(myArrayList.get(1));
        }catch (GetIndexOutOfException e){
            e.printStackTrace();
        }

        myArrayList.remove(5);
        myArrayList.display();
        myArrayList.clear();
        myArrayList.display();


    }
}
